package User;

import Book.Book;
import Book.Booklist;

import java.awt.*;
import java.util.Scanner;

public class Main {
    public static User logn() {

        Scanner sc=new Scanner(System.in);

        System.out.println("请输入你的名字：");
        String name=sc.nextLine();
        System.out.println("请输入你的身份1--》管理员，2--》普通用户");
        int choice=sc.nextInt();
        if (choice==1){
            Administor administor=new Administor(name);
            return administor;
        }
        else {
            Nomaluser nomaluser=new Nomaluser(name);
            return nomaluser;
        }
    }
    public static void main(String[] args) {
        Booklist booklist=new Booklist();
        User user=logn();
        while (true){
            int choice= user.meau();
            user.open(choice,booklist);
        }

    }
}